package cn.buildoncloud.labor.workermanapplet.business.modules.services.impl;

import cn.buildoncloud.labor.workermanapplet.business.modules.services.FeedbackFormService;
import cn.buildoncloud.labor.workermanapplet.common.base.service.BaseServiceImpl;
import cn.buildoncloud.labor.workermanapplet.util.HttpUtil;
import org.nutz.dao.Dao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class FeedbackFormServiceImpl extends BaseServiceImpl<Map> implements FeedbackFormService {
    public FeedbackFormServiceImpl(Dao dao) {
        super(dao);
    }

    @Value("${webSystemIP}")
    private String webSystemIP;

    @Override
    public Object submitFeedbackForm(Long userId, String content, String[] imagePaths) {
        Map<String, Object> parameterMap = new HashMap<>();
        parameterMap.put("userId", userId);
        parameterMap.put("content", content);
        parameterMap.put("images",imagePaths);
        Object result = HttpUtil.post(webSystemIP + "/feedbackForm/submitFeedbackForm", parameterMap, 1000 * 60);
        return result;
    }

}
